﻿using System;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;

namespace zykControl
{
    public partial class frmPYSel : Form
    {
        private clsPYSel mItemSel;
        private static frmPYSel iMe;

        public static void ShowA(clsPYSel theSel)
        {
            // ShowA函数用来显示本窗体,可以为本函数加参数,但一定要保证返回Boolean值
            if (iMe is null)
                iMe = new frmPYSel();
            iMe.mItemSel = theSel;
            iMe.ShowDialog();
            iMe.mItemSel = null;
        }

        private void frmPYSel_KeyDown(object eventSender, KeyEventArgs eventArgs)
        {
            if (eventArgs.KeyCode == Keys.Escape | eventArgs.KeyCode == Keys.Enter)
                Close();
            if (eventArgs.KeyCode == Keys.Back)
                mItemSel.setBack();
        }

        private void frmPYSel_KeyPress(object eventSender, KeyPressEventArgs eventArgs)
        {
            if (Conversions.ToString(eventArgs.KeyChar) == Constants.vbBack)
                return;
            mItemSel.setItem(Conversions.ToString(eventArgs.KeyChar));
        }

        private void labClose_Click(object eventSender, EventArgs eventArgs)
        {
            Close();
        }

        private void labRemove_MouseUp(object eventSender, MouseEventArgs eventArgs)
        {
            if (eventArgs.Button != MouseButtons.Right)
                mItemSel.setBack();
            if (eventArgs.Button == MouseButtons.Right)
                mItemSel.setClear();
        }

        private void lab0_MouseUp(object sender, MouseEventArgs e)




        {
            mItemSel.setItem(((Label)sender).Text);
        }
    }
}